
local jintao = fk.CreateSkill{
    name = "tyj_heg__jintao",
}

 Fk:loadTranslationTable{
      ["tyj_heg__jintao"]="进讨",
      [":tyj_heg__jintao"]="出牌阶段结束时，若你本阶段使用【杀】的次数不小于次数上限，你可以摸两张牌并令此上限+1。",
      ["#tyj__jintao-invoke"]="是否发动 进讨 摸两张牌并令使用【杀】的次数上限+1？",
      ["@tyj_heg__jintao-extraslash"]="进讨",
      ["#tyj__jintao_maxhand"]="进讨",
      ["$tyj_heg__jintao1"] = "一雪前耻，誓报前仇！",
      ["$tyj_heg__jintao2"] = "量敌而进，直讨吴境！",
      ["~tyj_heg__wuban"] = "恨……杀不尽吴狗！",
    }

jintao:addEffect(fk.EventPhaseEnd,{
    anim_type = "drawcard",
    can_trigger = function (self, event, target, player, data)
        if player:hasSkill(jintao.name) and target == player and player.phase == Player.Play then
            local card = Fk:cloneCard("slash")
            local card_skill = card.skill
            local status_skills = Fk:currentRoom().status_skills[TargetModSkill] or Util.DummyTable
            for _, skill in ipairs(status_skills) do
              if skill:bypassTimesCheck(player, card_skill, Player.HistoryPhase, card, nil) then return false end
            end
            if player:usedCardTimes("slash", Player.HistoryPhase) >= card_skill:getMaxUseTime(player, Player.HistoryPhase, card, nil) then
              return true
            end
          end
      end,
      on_cost = function (self, event, target, player, data)
        return player.room:askToSkillInvoke(player, {
        skill_name = jintao.name,
        prompt = "#tyj__jintao-invoke",
      })
      end,
      on_use = function (self, event, target, player, data)
        local Skillname = jintao.name
        local room = player.room
        room:drawCards(player,2,Skillname)
        local mark = player:getMark("@tyj_heg__jintao-extraslash")
        mark = mark+1
        room:setPlayerMark(player,"@tyj_heg__jintao-extraslash",mark)
      end,
})

jintao:addEffect("targetmod",{
    residue_func = function(self, player, skill, scope)
        if skill.trueName == "slash_skill" and player:getMark("@tyj_heg__jintao-extraslash") > 0 and scope == Player.HistoryPhase then
          return player:getMark("@tyj_heg__jintao-extraslash")
        end
      end,
})

return jintao